﻿using System;
using System.Configuration;

namespace CodePlex.TfsPluginSuite.Configuration.PatternBypassOverride
{
    [ConfigurationCollection(typeof(AccountOverrideConfigElement), AddItemName = "Group", CollectionType = ConfigurationElementCollectionType.BasicMap)]
    public class AccountOverrideConfigElementCollection : ConfigurationElementCollection
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new AccountOverrideConfigElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            return ((AccountOverrideConfigElement)element).Name;
        }

        [ConfigurationProperty("enabled", DefaultValue=(bool)false)]
        public bool Enabled
        {
            get
            {
                return (bool)base["enabled"];
            }
        }
    }
}
